import { getCartCount } from '@/api/cart/index.js'

const cart = {
    state: {
        cartCount: null,
    },
    mutations: {

    },
    actions: {
        getCartCount({ commit, state }) {
            getCartCount().then(res => {
                state.cartCount = res.data.count === 0 ? null : res.data.count
            }).catch(() => {

            })
        }
    }
}

export default cart